window.onload=function() {
    var oBox = document.getElementById('left-side');
    var pBox = document.getElementById('content-block');

    // var oBoxWidth = oBox.offsetWidth;
    // var pBoxWidth = pBox.offsetWidth;
    // var oBoxHtml = oBox.innerHTML;
    var button = document.getElementById('btn');
    var is_hidden = false;
    button.onclick = function () {
        // let is_hidden = getCookie('is_hidden');
        // console.log(is_hidden);
        if (is_hidden) {
            // oBox.innerHTML = oBoxHtml;
            oBox.style.display = 'block';
            // setCookie('is_hidden',false);
            is_hidden = false;
            pBox.style.width = '83.33333333%';
        } else {
             // oBox.innerHTML = '';
            oBox.style.display = 'none';
            // setCookie('is_hidden',true);
            is_hidden = true;
            pBox.style.width = '100%';
        }
    };
};

function getCookie(name)
{
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return false;
}

function setCookie(key,value){
    document.cookie=key+"="+value
}